﻿using System.Collections.Generic;
using System.Windows.Forms;
using SixthClassAssignment.DAL;

namespace SixthClassAssignment{
    public partial class LogWindow : Form{
        
        private void InitGrip(){
            dataGrid.ReadOnly = true;
            dataGrid .SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }
        private void ShowLogs(){
            List<Log> schools = SqlDao.selectLogList();
            dataGrid.DataSource = schools;
            dataGrid.Columns["No"].HeaderText = "序号";
            dataGrid.Columns["Time"].HeaderText = "时间";
            dataGrid.Columns["Action"].HeaderText = "操作";
        }
        private void Form_Closing(object sender, FormClosingEventArgs e){
            Hide();
            var window = new FunctionWindow("root");
            window.Show();
        }
        public LogWindow(){
            InitializeComponent();
            InitGrip();
            ShowLogs();
            FormClosing += Form_Closing;
        }
    }
}